home *** CD-ROM | disk | FTP | other *** search
- #ifndef __FABCURSORBALLOON__
- #define __FABCURSORBALLOON__
-
- /* this distinguishes a normal window from a window with objects */
-
- enum windowclasses {
- kFabWindowClass = 10
- };
-
- /* this is my window record, containing the standard Window Manager record,
- the procedures normally called when handling events (if you do not want to
- undertake special actions i.e. for dragging, pass nil), the number of
- objects, and a Handle to the objects */
-
- typedef struct RgnBalloonCurs RgnBalloonCurs;
- typedef RgnBalloonCurs *RgnBalloonCursPtr;
- typedef RgnBalloonCursPtr *RgnBalloonCursHandle;
-
- struct FabWindowRecord {
- WindowRecord w;
- ProcPtr activateProc,
- updateProc,
- dragProc,
- growProc,
- zoomProc,
- goAwayProc,
- contentProc;
- unsigned long objCount;
- RgnBalloonCursHandle myZones;
- };
-
- typedef struct FabWindowRecord FabWindowRecord;
- typedef FabWindowRecord *FabWindowPtr;
-
- /* this is a generic object belonging to a window */
-
- struct RgnBalloonCurs {
- void (*recalcRgnProc)(FabWindowPtr, RgnBalloonCursPtr);
- RgnHandle zoneLocal;
- RgnHandle zoneGlobal;
- CursHandle curs;
- unsigned long myBalloon;
- short balloonVariant;
- short reserved; /* alignment */
- };
-
-
- OSErr InstallRgnHandler(FabWindowPtr w, RgnHandle whichRgn, void (*recalcProc)(FabWindowPtr, RgnBalloonCursPtr),
- CursHandle cursor,
- unsigned long balloon, short ballnVariant);
- void RecalcMouseRegion(WindowPtr w, Point mouse);
- void ResizeObjects(FabWindowPtr w);
- void RecalcGlobalCoords(FabWindowPtr w);
- void DisposFabWindow(FabWindowPtr w);
- void ForceMouseMovedEvent(void);
-
- /* useful macros */
-
- #define toBalloon(m, i) (((long)m << 16) + i)
-
- #define Zones(w) (((FabWindowPtr)w)->myZones)
-
- #define InitFabWindow(w) { Zones(w) = (RgnBalloonCursHandle)NewHandle(0); \
- ((WindowPeek)w)->windowKind = kFabWindowClass; }
-
- /* macros for setting the event handlers for the window, and
- prototypes of the handlers */
-
- // void DoActivateWindow(WindowPtr w, Boolean becomingActive);
- #define SetActivate(w, p) ((FabWindowPtr)w)->activateProc = (ProcPtr)(p)
-
- // void DoUpdateWindow(WindowPtr w);
- #define SetUpdate(w, p) ((FabWindowPtr)w)->updateProc = (ProcPtr)(p)
-
- // void DoDragWindow(WindowPtr w);
- #define SetDrag(w, p) ((FabWindowPtr)w)->dragProc = (ProcPtr)(p)
-
- // void DoGrowWindow(WindowPtr w, EventRecord *event);
- #define SetGrow(w, p) ((FabWindowPtr)w)->growProc = (ProcPtr)(p)
-
- // void DoZoomWindow(WindowPtr w);
- #define SetZoom(w, p) ((FabWindowPtr)w)->zoomProc = (ProcPtr)(p)
-
- // void DoCloseWindow(WindowPtr w);
- #define SetGoAway(w, p) ((FabWindowPtr)w)->goAwayProc = (ProcPtr)(p)
-
- // void DoContentClick(WindowPtr w, EventRecord *event);
- #define SetContent(w, p) ((FabWindowPtr)w)->contentProc = (ProcPtr)(p)
-
- #define NumObjects(w) (((FabWindowPtr)w)->objCount)
- #define OneMoreObject(w) (((FabWindowPtr)w)->objCount++)
-
- #define IsFabWindow(w) (((WindowPeek)w)->windowKind == kFabWindowClass)
-
- extern RgnHandle mouseRgn, wideOpenRgn;
-
- #endif
-
-